﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:controlsPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls" 
    x:Class="Twatcher.MainPage" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696" 
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True" BackKeyPress="PhoneApplicationPage_BackKeyPress">
	<phone:PhoneApplicationPage.Resources>
		<Storyboard x:Name="homePop">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="pitmHome">
				<EasingDoubleKeyFrame KeyTime="0" Value="1.01"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="pitmHome">
				<EasingDoubleKeyFrame KeyTime="0" Value="538.75"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="pitmHome">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="aboutPop">
			<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)" Storyboard.TargetName="pitmAbout">
				<EasingPointKeyFrame KeyTime="0" Value="0.5,0.5"/>
				<EasingPointKeyFrame KeyTime="0:0:1" Value="0,0"/>
			</PointAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="pitmAbout">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationZ)" Storyboard.TargetName="pitmAbout">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="pitmAbout">
				<EasingDoubleKeyFrame KeyTime="0" Value="536"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<DataTemplate x:Key="trendListItem">
			<StackPanel Height="30" Width="456" Background="#19FFFFFF" >
				<TextBlock HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Text="{Binding name}"/>
			</StackPanel>
		</DataTemplate>
		<Style x:Key="PivotStyle1" TargetType="controls:Pivot">
			<Setter Property="Margin" Value="0"/>
			<Setter Property="Padding" Value="0"/>
			<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="ItemsPanel">
				<Setter.Value>
					<ItemsPanelTemplate>
						<Grid/>
					</ItemsPanelTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="controls:Pivot">
						<Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="*"/>
							</Grid.RowDefinitions>
							<Grid Background="{TemplateBinding Background}" CacheMode="BitmapCache" Grid.RowSpan="3"/>
							<ContentPresenter ContentTemplate="{TemplateBinding TitleTemplate}" Content="{TemplateBinding Title}" Margin="24,17,0,-7"/>
							<controlsPrimitives:PivotHeadersControl x:Name="HeadersListElement" Grid.Row="1" FontFamily="/Twatcher;component/Fonts/Fonts.zip#[z] Arista" FontSize="20"/>
							<ItemsPresenter x:Name="PivotItemPresenter" Margin="{TemplateBinding Padding}" Grid.Row="2"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</phone:PhoneApplicationPage.Resources>
 
    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar x:Name="appBar" BackgroundColor="Black" ForegroundColor="#FFFFCC15">
			<shell:ApplicationBarIconButton x:Name="btnSaveTag" IconUri="/icons/appbar.favs.addto.rest.png" Text="bookmark" Click="btnSaveTag_Click" IsEnabled="True"/>
			<shell:ApplicationBarIconButton x:Name="btnLoad" IconUri="/icons/appbar.download.rest.png" Text="load" Click="btnLoad_Click"/>
			<shell:ApplicationBarIconButton x:Name="btnDeleteTag" IconUri="/icons/appbar.delete.rest.png" Text="delete" Click="btnDeleteTag_Click" IsEnabled="True"/>
			<shell:ApplicationBarIconButton x:Name="btnSetting" IconUri="/icons/appbar.sync.rest.png" Text="refresh" Click="btnSetting_Click" IsEnabled="True"/>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="#FF4ED3FF">
        <!--Pivot Control-->
        <controls:Pivot x:Name="myPivot"  Title="twatcher : twitter tag watcher" Foreground="White" Style="{StaticResource PivotStyle1}">
            <controls:Pivot.TitleTemplate>
		        <DataTemplate>
		            <TextBlock Text="{Binding}" FontFamily="/Twatcher;component/Fonts/Fonts.zip#[z] Arista" FontSize="20" Margin="0,5,0,0"/>		        
				</DataTemplate>
    		</controls:Pivot.TitleTemplate>
			<controls:Pivot.HeaderTemplate>
		        <DataTemplate>
		            <TextBlock Text="{Binding}" FontFamily="/Twatcher;component/Fonts/Fonts.zip#[z] Arista Light" FontSize="72" Margin="0,20,0,0"/>		        
				</DataTemplate>
    		</controls:Pivot.HeaderTemplate>
            <controls:PivotItem x:Name="pitmHome" Header="home" Background="#66000000" RenderTransformOrigin="0.5,0.5" Loaded="pitmHome_Loaded" FontFamily="Segoe WP">
            	<controls:PivotItem.RenderTransform>
            		<CompositeTransform/>
            	</controls:PivotItem.RenderTransform>
            	<StackPanel>
            		<TextBox x:Name="tbTag" TextWrapping="Wrap"/>
            		<Button x:Name="btnAddTag" Content="add Tag" Click="btnAddTag_Click" Foreground="White" BorderBrush="#FFCEE9F3" FontFamily="/Twatcher;component/Fonts/Fonts.zip#[z] Arista Light"/>
            		<TextBlock TextWrapping="Wrap" Text="Trendy Tag" HorizontalAlignment="Right" Margin="0,0,15,5" FontFamily="/Twatcher;component/Fonts/Fonts.zip#[z] Arista Light"/>
            		<ListBox x:Name="trendList" Height="350" BorderThickness="10,0" ItemTemplate="{StaticResource trendListItem}" SelectionChanged="trendList_SelectionChanged" FontFamily="Segoe WP"/>
            	</StackPanel>
                <!--Double line list with text wrapping-->
            </controls:PivotItem>
			<controls:PivotItem x:Name="pitmAbout" Header="about" Background="#7F000000" Foreground="White" FontFamily="Segoe WP">
				<controls:PivotItem.Projection>
					<PlaneProjection/>
				</controls:PivotItem.Projection>
				<controls:PivotItem.RenderTransform>
					<CompositeTransform/>
				</controls:PivotItem.RenderTransform>
				<StackPanel>
					<TextBlock TextWrapping="Wrap" Margin="15,15,15,5" Height="443"><Run Text="Use this app to Follow Twitter's Tweet tag that you want to follow. "/><LineBreak/><Run Text="        *Just input your tag in textbox in home page then tap add Tag (or else browse trendy tag from list down that button). "/><LineBreak/><Run Text="        *If you want to keep follow that tag again next time tap &quot;Bookmark&quot; button at AppBar."/><LineBreak/><Run Text="        *Don't be panic if you open this app after you just &quot;Bookmark&quot; and see nothing Just tap &quot;Sync&quot; to sync all your tag again."/><LineBreak/><Run Text="        *So after you not interest in some tag you save then just tap &quot;Delete&quot;."/><LineBreak/><Run/><LineBreak/><Run/><LineBreak/><Run/><LineBreak/></TextBlock>
				</StackPanel>
			</controls:PivotItem>
 
            <!--Pivot item two-->
        </controls:Pivot>
    </Grid>

</phone:PhoneApplicationPage>